﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace CommunitySystem.PageView
{
    public class JinShenConst
    {
        #region 状态
        public const string STATUS_Solution_Submit = "提交申请";

        public const string STATUS_SolutionPass = "审核通过";

        public const string STATUS_Solution_Retire = "审核不通过";

        public const string STATUS_CandidateChecking = "人员审核";

        public const string STATUS_CandidateCheck_Pass = "人员审核通过";

        public const string STATUS_CandidateCheck_UnPass = "人员审核不通过";
       

        public const string STATUS_Candidate_Approved = "人员核定";

        public const string STATUS_Candidate_Inspect = "人员考察";

        public const string STATUS_Party_Meeting = "上党工委组会议";

        public const string STATUS_Candidate_Show = "候选人公示";

        public const string STATUS_Promot_Apply = "晋升申请";

        public const string STATUS_Promot_Agree = "晋升确认";
        #endregion

        public static List<string> Administrator = new List<string>() { "系统操作", "管理员" };
        public static List<string> HR = new List<string>() { "人事干部" };

        #region 动作

        public const string ACTION_Solution_New = "新建晋升方案";

        public const string ACTION_Solution_Modify = "编辑晋升方案";

        public const string ACTION_Solution_Delete = "删除晋升方案";

        public const string ACTION_Solution_Check = "晋升方案审核";

        public const string ACTION_Candidate_New = "增加人员";

        public const string ACTION_Candidate_Check = "人员审核";

        public const string ACTION_Candidate_Evalution = "民主测评及竞争上岗";

        public const string ACTION_Candidate_Approval = "人员核定";

        public const string ACTION_Candidate_Inspect = "人员考察";

        #endregion

        /// <summary>
        /// 判断当前状态是否可以进行某种操作
        /// </summary>
        /// <param name="JinShen_Status">当前状态</param>
        /// <param name="JinShen_Action">动作</param>
        /// <returns></returns>
        public static bool CanAction(string JinShen_Status, string JinShen_Action)
        {
            switch (JinShen_Action)
            {
                case ACTION_Solution_New:
                    if (string.IsNullOrEmpty(JinShen_Status))
                        return true;
                    else
                        return false;

                case ACTION_Solution_Modify:

                case ACTION_Solution_Delete:
                    switch (JinShen_Status)
                    {
                        case STATUS_Solution_Submit:
                        case STATUS_Solution_Retire:
                            return true;
                        default:
                            return false;
                    }

                case ACTION_Solution_Check:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_Solution_Submit:
                        case JinShenConst.STATUS_SolutionPass:
                        case JinShenConst.STATUS_Solution_Retire:
                            return true;
                        default:
                            return false;
                    }

                case ACTION_Candidate_New:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_SolutionPass:
                        case JinShenConst.STATUS_CandidateChecking:
                        case JinShenConst.STATUS_CandidateCheck_UnPass:
                            return true;
                        default:
                            return false;
                    }

                case ACTION_Candidate_Check:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_CandidateChecking:
                        case JinShenConst.STATUS_CandidateCheck_UnPass:
                        case JinShenConst.STATUS_CandidateCheck_Pass:
                            return true;
                        default:
                            return false;
                    };

                case ACTION_Candidate_Evalution:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_CandidateCheck_Pass:
                        case JinShenConst.STATUS_Candidate_Approved:
                            return true;
                        default:
                            return false;
                    };

                case ACTION_Candidate_Approval:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_Candidate_Inspect:
                        case JinShenConst.STATUS_Candidate_Approved:
                            return true;
                        default:
                            return false;
                    };

                case ACTION_Candidate_Inspect:
                    switch (JinShen_Status)
                    {
                        case JinShenConst.STATUS_Candidate_Inspect:
                        case JinShenConst.STATUS_Party_Meeting:
                        case JinShenConst.STATUS_Candidate_Show:
                        case JinShenConst.STATUS_Promot_Apply:
                        case JinShenConst.STATUS_Promot_Agree:
                            return true;
                        default:
                            return false;
                    };
                default:
                    return false;

            }

        }

    }
}
